﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Headquarter.Master" AutoEventWireup="true" CodeBehind="~/Products.aspx.cs" Inherits="GUI.Headquarter.Products" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Produtos</title>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h1>Produtos</h1>
    
    <fieldset>
        <legend>Adicionar novo produto</legend>
        <label for='<%= desig.ClientID %>'>Designação</label>
        <input id='desig' runat='server' />

        <label for='<%= price.ClientID %>'>Preço</label>
        <input id='price' runat='server'  onkeyup="this.value=this.value.replace(/[^\d\.]/,'')" onblur="this.value=parseFloat(this.value).toFixed(2)"/>

        <label for='<%= stock.ClientID %>'>Stock</label>
        <input id='stock' runat='server' onkeyup="this.value=this.value.replace(/[^\d]/,'')" />

        <label for='<%= minStock.ClientID %>'>Stock Mínimo</label>
        <input id='minStock' runat='server' onkeyup="this.value=this.value.replace(/[^\d]/,'')" />

        <label for='<%= TypeDropDownList.ClientID %>'>Tipo</label>
        <asp:DropDownList ID="TypeDropDownList" runat="server">
        </asp:DropDownList>

        <label for='<%= SupplierDropDownList.ClientID %>'>Fornecedor</label>
        <asp:DropDownList ID="SupplierDropDownList" runat="server">
        </asp:DropDownList>

        <asp:Button ID="Button1" Text="Adicionar" runat="server" OnClick="OnAddProduct"/>
    </fieldset>

    <fieldset>
        <legend>Actualizar stock</legend>
        <label for='<%= productID.ClientID %>'>Id do Produto</label>
        <input id='productID' runat='server' />

        <label for='<%= updStock.ClientID %>'>Quantidade</label>
        <input id='updStock' runat='server' onkeyup="this.value=this.value.replace(/[^\d]/,'')"/>

        <asp:Button ID="Button2" Text="Actualizar" runat="server" OnClick="OnUpdateStock" />
    </fieldset>
</asp:Content>